package com.itheima.homework.hw01.part01;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Test {
    static List<Student> students = new ArrayList<>();

    static {
        Student stu1 = new Student(1, "小亮", 99);
        Student stu2 = new Student(2, "小勇", 85);
        Student stu3 = new Student(3, "小响", 90);
        Student stu4 = new Student(4, "小强", 78);
        Collections.addAll(students, stu1, stu2, stu3, stu4);
    }

    public static void main(String[] args) {
        Collections.sort(students, (o1, o2) -> Integer.compareUnsigned(o1.getResult(), o2.getResult()));
        for (Student s : students) {
            System.out.println(s);
            ;
        }
    }
}
